import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/view/index'
import View from '@/view/view'
import Backstage from '@/view/backstage/index'
import MerchantBackstage from '@/view/backstage/merchantBackstage'
import Special from '@/view/activity/special'
import business from '@/view/business'
import order from '@/view/business/order'
import douyin from '@/view/business/douyin'
import wx from '@/view/business/wx'
import child from '@/view/home/child'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      children: [
        {
          path: '/view',
          meta: "view",
          name: '首页',
          component: View,
        },
        {
          path: '/backstage/index',
          meta: "backstage",
          name: '达人后台',
          component: Backstage,
        },
        {
          path: '/activity/special',
          meta: "special",
          name: '商家后台',
          component: Special,
        },
        {
          path: '/business',
          meta: "business",
          name: '商家后台',
          component: business,
          children: [
            {
              path: '/backstage/merchantBackstage',
              meta: "merchantBackstage",
              name: '商家后台',
              component: MerchantBackstage,
            },
            {
              path: '/business/order',
              meta: "order",
              name: '商家后台订单',
              component: order,
            },
            {
              path: '/business/douyin',
              meta: "douyin",
              name: '抖音',
              component: douyin,
            },
            {
              path: '/business/wx',
              meta: "wx",
              name: '微信',
              component: wx,
            },
          ]
        },
        {
          path: '/home/child/:id',
          meta: "child",
          name: '达人页面',
          component: child,
        },
      ]
    }
  ]
})
